Skip to content

Slim runner package#4384

Open
paveliak wants to merge 6 commits intoactions:mainfrom
paveliak:slim-runner
Open

Slim runner package#4384
paveliak wants to merge 6 commits intoactions:mainfrom
paveliak:slim-runner

Conversation

@paveliak
Copy link
Copy Markdown
Contributor

This PR adds new "slim" flavor of Runner package. It differs from the existing runner package in two ways:

  1. externals folder containing Node distribution is removed
  2. Runner is archived with zstd using compression level 19

When invoking runner RUNNER_EXTERNALSDIRECTORY environment variable is expected to point to the directory whose structure matches the externals directory of the "full" runner package

Copilot AI review requested due to automatic review settings April 28, 2026 14:27
@paveliak paveliak requested a review from a team as a code owner April 28, 2026 14:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new “slim” runner package variant intended for scenarios where the externals (Node distribution) directory is provided out-of-band via RUNNER_EXTERNALSDIRECTORY, and publishes these slim artifacts alongside existing “full” runner packages.

Changes:

  • Update packaging (src/dev.sh) to produce additional actions-runner-slim-* archives, excluding externals and using zstd compression (level 19).
  • Update runtime externals resolution (HostContext.GetDirectory(Externals)) to honor RUNNER_EXTERNALSDIRECTORY with a fallback to the in-package externals.
  • Update release workflow to compute SHA for the non-slim artifact and upload slim .tar.zst assets to GitHub Releases.
Show a summary per file
File Description
src/dev.sh Adds creation of slim runner archives and zstd compression.
src/Runner.Common/HostContext.cs Allows externals directory override via RUNNER_EXTERNALSDIRECTORY.
.github/workflows/release.yml Adjusts SHA computation to ignore slim artifacts and uploads slim assets.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 5

Comment on lines +388 to +395
path = Environment.GetEnvironmentVariable("RUNNER_EXTERNALSDIRECTORY");

if (string.IsNullOrEmpty(path))
{
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root),
Constants.Path.ExternalsDirectory);
}
Comment on lines 387 to +395
case WellKnownDirectory.Externals:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root),
Constants.Path.ExternalsDirectory);
path = Environment.GetEnvironmentVariable("RUNNER_EXTERNALSDIRECTORY");

if (string.IsNullOrEmpty(path))
{
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root),
Constants.Path.ExternalsDirectory);
}
Comment on lines 109 to 113
- run: |
file=$(ls)
file=$(ls | grep -v slim)
sha=$(sha256sum $file | awk '{ print $1 }')
echo "Computed sha256: $sha for $file"
echo "${{matrix.runtime}}-sha256=$sha" >> $GITHUB_OUTPUT
Comment thread src/dev.sh
tar_name="${runner_pkg_name}.tar.gz"
echo "Creating $tar_name in ${LAYOUT_DIR}"
tar -czf "${tar_name}" -C "${LAYOUT_DIR}" .
slim_tar_name="${runner_slim_pkg_name}.tar.zst"
Comment thread src/dev.sh
$POWERSHELL -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "Add-Type -Assembly \"System.IO.Compression.FileSystem\"; [System.IO.Compression.ZipFile]::CreateFromDirectory(\"${window_path}\", \"${zip_name}\")"
slim_tar_name="${runner_slim_pkg_name}.tar.zst"
echo "Creating $slim_tar_name in ${window_path}"
$POWERSHELL -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "\$env:ZSTD_CLEVEL=\"19\"; tar -cf \"${slim_tar_name}\" -C \"${window_path}\" --zstd --exclude=\"externals\" ."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants